/**
  ******************************************************************************
  * @author     Chris
  * @since      2024/6/21 22:31
  *
  * @file       pd_i2c_hd.h
  * @brief      Header file of I2C hardware peripheral driver.
  *
  * @note       This file contains the I2C object declaration.
  *
  * @warning    None.
  ******************************************************************************
  * Change Logs:
  *   Date          Author       Notes
  *   2024/6/21     Chris        the first version
  *
  ******************************************************************************
  */


#ifndef JLC_SKY_I2C_HD_H
#define JLC_SKY_I2C_HD_H

#include "pd_i2c.h"

// Object properties
typedef struct {
    I2C i2c;

    I2C_TypeDef *I2Cx;
    uint32_t PeripheralMode;
    uint32_t ClockSpeed;
    uint32_t DutyCycle;
#if  defined(I2C_FLTR_ANOFF) && defined(I2C_FLTR_DNF)
    uint32_t AnalogFilter;
    uint32_t DigitalFilter;
#endif
    uint32_t OwnAddress1;
    uint32_t TypeAcknowledge;
    uint32_t OwnAddrSize;

    struct I2CHardwareVtbl *vptr;
} I2CHardware; // extends {@see I2C}

// Object constructor and member function
void I2CHardware_constructor(I2CHardware *this, I2C_TypeDef *I2Cx, GPIO *sck, GPIO *sda);


#endif //JLC_SKY_I2C_HD_H
